package com.billing.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.billing.model.dao.ManagerPermissionsMapper;
import com.billing.model.entity.TManagerPermissions;
import com.billing.model.entity.TUser;
import com.billing.service.ManagerPermissionsService;
@Service
public class ManagerPermissionsServiceImpl implements ManagerPermissionsService {

	@Resource
	private ManagerPermissionsMapper managerPermissionsMapper;
	
	@Override
	public List<TManagerPermissions> getManagerPermissionsList(int id) {
		return managerPermissionsMapper.getManagerPermissionsList(id);
	}

	@Override
	public int updateTManagerPermissions(TManagerPermissions permissions) {
		return managerPermissionsMapper.updateTManagerPermissions(permissions);
	}

	@Override
	public int insertTManagerPermissions(TManagerPermissions permissions) {
		return managerPermissionsMapper.insertTManagerPermissions(permissions);
	}

	@Override
	public int deleteTManagerPermissions(int id) {
		return managerPermissionsMapper.deleteTManagerPermissions(id);
	}

	@Override
	public List<TManagerPermissions> getManagerPermissionsLists() {
		return managerPermissionsMapper.getManagerPermissionsLists();
	}

	@Override
	public boolean selectPermissionsByCode(Integer userid, String code) {
		TManagerPermissions tmp = managerPermissionsMapper.selectPermissionsByCode(userid,code);
		if (tmp!=null) {
			return true;
		}
		return false;
	}

	@Override
	public List<TManagerPermissions> selectPermissionsById(int id) {
		return managerPermissionsMapper.selectPermissionsById(id);
	}

}
